package com.tyros.storage.modules.file.api;

import com.tyros.storage.modules.file.dto.request.FilePageQueryDTO;
import com.tyros.storage.modules.file.service.FileService;
import com.tyros.web.support.message.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangshuaiyin
 * @date 2022/3/20 19:05
 */
@RestController
@Api(tags = "文件资源管理")
@RequestMapping("resources")
public class FileController {
    private final FileService fileService;

    public FileController(FileService fileService) {
        this.fileService = fileService;
    }

    @ApiOperation("分页列表")
    @GetMapping
    public R<?> list(FilePageQueryDTO pageQuery) {
        return R.success(fileService.page(pageQuery));
    }
}
